﻿@model ADShop.Models.Category
@using ADShop.Repository
@{
    ViewBag.Title = "Edit";
}

<h2>Edit Category</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    @*<fieldset>
        <legend>Category</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.IDCategory)
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.IDCategory)
            @Html.ValidationMessageFor(model => model.IDCategory)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ParentIDCategory)
        </div>
        <div class="editor-field">
            @Html.DropDownList("ddlPri",Global.ListIDPri())
            @Html.ValidationMessageFor(model => model.ParentIDCategory)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.NameCategory)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.NameCategory)
            @Html.ValidationMessageFor(model => model.NameCategory)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Details)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Details)
            @Html.ValidationMessageFor(model => model.Details)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Active)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Active)
            @Html.ValidationMessageFor(model => model.Active)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>*@
    <div class="panel-body">
            <table class="table table-hover" id="sample-table-1">
                <thead>
                    <tr>

                        <th>@Html.DisplayNameFor(model => model.IDCategory)</th>
                        <th>@Html.DisplayNameFor(model => model.NameCategory)</th>
                        <th>@Html.DisplayNameFor(model => model.ParentIDCategory)</th>
                        <th>@Html.DisplayNameFor(model => model.Details)</th>
                        <th>@Html.DisplayNameFor(model => model.Active)</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.IDCategory)
                                @Html.ValidationMessageFor(model => model.IDCategory)
                            </div>
                        </td>

                        <td>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.NameCategory)
                                @Html.ValidationMessageFor(model => model.NameCategory)
                            </div>
                        </td>
                      
                        <td>
                            <div class="editor-field">
                                @Html.DropDownListFor(model => model.ParentIDCategory, (IEnumerable<SelectListItem>)Global.ListIDCat())

                                @Html.ValidationMessageFor(model => model.ParentIDCategory)
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.Details)
                                @Html.ValidationMessageFor(model => model.Details)
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.Active)
                                @Html.ValidationMessageFor(model => model.Active)
                            </div>
                        </td>

                    </tr>
                    



                </tbody>


            </table>

        </div>
        <p>
            <input type="submit" value="Save" class="btn btn-green" />
        </p>
}

<div>
    @Html.ActionLink("Bảng Danh Mục Nhà Sản Xuất", "Index", null, new { @class = "label label-default" })
</div>
